package ua.openmedis.domain;

// Generated Aug 22, 2011 4:58:43 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Facilities generated by hbm2java
 */
@Entity
@Table(name = "facilities", catalog = "openmedis_demo")
public class Facilities implements java.io.Serializable {

	private Integer facilityId;
	private Districts districts;
	private String facilityName;
	private Set<Location> locations = new HashSet<Location>(0);
	private Set<EssentialEquipment> essentialEquipments = new HashSet<EssentialEquipment>(
			0);

	public Facilities() {
	}

	public Facilities(Districts districts, String facilityName,
			Set<Location> locations, Set<EssentialEquipment> essentialEquipments) {
		this.districts = districts;
		this.facilityName = facilityName;
		this.locations = locations;
		this.essentialEquipments = essentialEquipments;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "FacilityID", unique = true, nullable = false)
	public Integer getFacilityId() {
		return this.facilityId;
	}

	public void setFacilityId(Integer facilityId) {
		this.facilityId = facilityId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "DistrictID")
	public Districts getDistricts() {
		return this.districts;
	}

	public void setDistricts(Districts districts) {
		this.districts = districts;
	}

	@Column(name = "FacilityName")
	public String getFacilityName() {
		return this.facilityName;
	}

	public void setFacilityName(String facilityName) {
		this.facilityName = facilityName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "facilities")
	public Set<Location> getLocations() {
		return this.locations;
	}

	public void setLocations(Set<Location> locations) {
		this.locations = locations;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "facilities")
	public Set<EssentialEquipment> getEssentialEquipments() {
		return this.essentialEquipments;
	}

	public void setEssentialEquipments(
			Set<EssentialEquipment> essentialEquipments) {
		this.essentialEquipments = essentialEquipments;
	}

}
